From 9ab714c7b06a04e38d5d26b3beef45f138365b40 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 30 May 1993 18:34:54 +0000 Subject: [PATCH] (wait_for_termination): Add POSIX_SIGNALS alternative. --- src/sysdep.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/sysdep.c b/src/sysdep.c index c067ffa499c..167b9c398a9 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -339,6 +339,15 @@ wait_for_termination (pid) break; wait (0); #else /* neither BSD nor UNIPLUS nor LINUX: random sysV */ +#ifdef POSIX_SIGNALS /* would this work for LINUX as well? */ + sigblock (sigmask (SIGCHLD)); + if (0 > kill (pid, 0)) + { + sigunblock (sigmask (SIGCHLD)); + break; + } + sigpause (sigmask (SIGCHLD)); +#else /* not POSIX_SIGNALS */ #ifdef HAVE_SYSV_SIGPAUSE sighold (SIGCHLD); if (0 > kill (pid, 0)) @@ -355,6 +364,7 @@ wait_for_termination (pid) we lose just one second. */ sleep (1); #endif /* not HAVE_SYSV_SIGPAUSE */ +#endif /* not POSIX_SIGNALS */ #endif /* not UNIPLUS */ #endif /* not BSD, and not HPUX version >= 6 */ #endif /* not VMS */ -- 2.30.2